﻿//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------

using GameFramework;
using System.Numerics;

namespace LS
{
    /// <summary>
    /// System.Int16 变量类。
    /// </summary>
    public sealed class VarBigInteger : Variable<BigInteger>
    {
        /// <summary>
        /// 初始化 System.Int16 变量类的新实例。
        /// </summary>
        public VarBigInteger()
        {
        }

        /// <summary>
        /// 从 System.Numerics.BigInteger 到 VarBigInteger 变量类的隐式转换。
        /// </summary>
        /// <param name="value">值。</param>
        public static implicit operator VarBigInteger(BigInteger value)
        {
            VarBigInteger varValue = ReferencePool.Acquire<VarBigInteger>();
            varValue.Value = value;
            return varValue;
        }

        /// <summary>
        /// 从 System.VarBigInteger 变量类到 System.Numerics.BigInteger 的隐式转换。
        /// </summary>
        /// <param name="value">值。</param>
        public static implicit operator BigInteger(VarBigInteger value)
        {
            return value.Value;
        }
    }
}
